package com.jinzhi.common.domain;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jinzhi.common.vo.PageInfoVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <pre>
 * </pre>
 * <small> 2018年3月23日 | Aron</small>
 */
@TableName("sys_log")
@Data
public class LogDO extends PageInfoVo implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = -938654836571738415L;
    
    @TableId
    private Long id;

    @ApiModelProperty(value = "用户id")
    @TableField("userId")
    private Long userId;

    @ApiModelProperty(value = "用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty(value = "用户操作")
    @TableField("operation")
    private String operation;

    @ApiModelProperty(value = "响应时间")
    @TableField("time")
    private Integer time;

    @ApiModelProperty(value = "请求方法")
    @TableField("method")
    private String method;

    @ApiModelProperty(value = "请求参数")
    @TableField("params")
    private String params;

    @ApiModelProperty(value = "IP地址")
    @TableField("ip")
    private String ip;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    @ApiModelProperty(value = "角色id,多个用，分隔")
    @TableField("role_id")
    private String roleId;

    @ApiModelProperty(value = "角色")
    @TableField(exist = false)
    private List<Long> roleIds;

    @ApiModelProperty(value = "角色名称")
    @TableField("role_name")
    private String roleName;

    @ApiModelProperty(value = "操作地址")
    @TableField("operation_address")
    private String operationAddress;

    @ApiModelProperty(value = "状态(0成功 1失败)")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "日志编号")
    @TableField("log_no")
    private String logNo;

    @ApiModelProperty(value = "系统模块(1用户管理 2月嫂管理 3需求管理 5订单管理 " +
            "6商品管理 7合同管理 8评价管理 9标签管理 10服务项目管理 11Banner管理 12基础管理)")
    @TableField("sys_module")
    private Integer sysModule;

    @ApiModelProperty(value = "操作类型( 1新增 2删除 3编辑 4 导出 5 导入)")
    @TableField("operation_type")
    private Integer operationType;

    @ApiModelProperty(value = "起始时间")
    @TableField(exist = false)
    private String startTime;

    @ApiModelProperty(value = "起始时间")
    @TableField(exist = false)
    private String endTime;

    @ApiModelProperty(value = "ids")
    @TableField(exist = false)
    private List<Long> ids;
}